
def mySort(alist):
    for i in range(0, len(alist) - 1):
        for j in range(0, len(alist) - i - 1):
            if alist[j] > alist[j + 1]:
                alist[j], alist[j + 1] = alist[j + 1], alist[j]

    return alist
# 函数调用
xlist = [2,32,1,24,52,55]
print(mySort(xlist))

# 缺省参数，默认参数
def login(password,username="admin"):
    if username == "admin" and password == "admin123":
        return {"status":200,"msg":"登录成功"}
    else:
        return {"status": 400, "msg": "用户名或者密码错误"}
print(login("admin123","admin"))

# 可变参数
def add(*args):
    sum = 0
    for a in args:
        sum += a
    return sum
result = add(1,2,3,4,5)
print(result)